package com.shuatim.common.exception;

import com.shuatim.common.enums.CustomHttpStatus;

/**
 * @author : issuser ✌️
 * @date : 2019/4/17 12:55
 */
public class ShuaTiException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    private String msg;
    private int code = 500;
    private CustomHttpStatus customHttpStatus;

    public ShuaTiException(CustomHttpStatus customHttpStatus) {
        super(customHttpStatus.getName());
        this.customHttpStatus = customHttpStatus;
        this.msg = customHttpStatus.getName();
        this.code = customHttpStatus.getCode();
    }

    public ShuaTiException(String msg) {
        super(msg);
        this.msg = msg;
    }

    public ShuaTiException(String msg, Throwable e) {
        super(msg, e);
        this.msg = msg;
    }

    public ShuaTiException(String msg, int code) {
        super(msg);
        this.msg = msg;
        this.code = code;
    }

    public ShuaTiException(String msg, int code, Throwable e) {
        super(msg, e);
        this.msg = msg;
        this.code = code;
    }


    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public CustomHttpStatus getCustomHttpStatus() {
        return customHttpStatus;
    }

    public void setCustomHttpStatus(CustomHttpStatus customHttpStatus) {
        this.customHttpStatus = customHttpStatus;
    }
}
